﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Baosight.Ccs.Mail.Properties;
using LumiSoft.Net.SMTP.Client ;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using LumiSoft.Net;

namespace Baosight.Ccs.Mail
{
    public class SendMailManager
    {             
        //发送邮件处理结果的操作
        public void SendMail(Mail mail)
        {
            try
            {
                Mail result = new Mail();
                result.FromAddress = Settings.Default.SmtpFromAddress;
                result.ToAddress = mail.FromAddress;
                result.HtmlBody = mail.Status ;                
                result.Subject = "工时卡处理结果";
                MailManager.Instance.SendMail(result);
                
            }
            catch (Exception ex)
            {
                ExceptionPolicy.HandleException(ex, MailConstants.PersistMailFailExceptionPolicy);
            }
            
        }
    }
}
